﻿<script src="jquery-1.4.1-vsdoc.js" type="text/javascript"></script>

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="HDFileManager.aspx.cs" Inherits="HDFileManager"
    ValidateRequest="false" %>

<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Linq" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Security.AccessControl" %>
<%@ Import Namespace="System.IO" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script src="jquery-1.4.3.min.js" type="text/javascript"></script>
    <script src="jQuery.blockUI.js" type="text/javascript"></script>
    <%--************ JAVA SCRIPT ************ --%>
    <script type="text/javascript">
        // ***********************
        // global variables
        hdDataProviderURL = "HDFileManager.aspx";
        hdLineObjOffsetTop = 2;
        hdLeftSidePath = "c:/";
        hdRightSidePath = "c:/";

        // ***********************
        // util methods
        function readablizeBytes(bytes) {
            if (bytes == 0) {
                return '';
            }
            else {
                var s = ['b', 'kb', 'MB', 'GB', 'TB', 'PB'];
                var e = Math.floor(Math.log(bytes) / Math.log(1024));
                return (bytes / Math.pow(1024, Math.floor(e))).toFixed(1) + " " + s[e];
            }
        }

        function positionLineObj(obj, ta) {
            var newTopValue = $(ta).scrollTop() * -1 + hdLineObjOffsetTop;
            $(obj).css("top", newTopValue);
        }

        String.prototype.endsWith = function (str) { return (this.match(str + "$") == str) }

        function createRClickMenu() {
            $.fn.showMenu = function (options) {
                var opts = $.extend({}, $.fn.showMenu.defaults, options);
                $(this).bind("contextmenu", function (e) {

                    assignRightClickMenuItemsEvents(opts.query, $(this), opts.side);
                    $(opts.query).show().css({
                        top: e.pageY + "px",
                        left: e.pageX + "px",
                        position: "absolute",
                        opacity: opts.opacity,
                        zIndex: opts.zindex
                    });
                    return false;
                });
                $(document).bind("click", function (e) {
                    $(opts.query).hide();
                });
            };

            $.fn.showMenu.defaults = {
                zindex: 2000,
                query: document,
                opacity: 0.8,
                side: 'left'
            };
        }

        function assignMenuEvents() {
            /*$find(".hdwfm-file-explorer-bottom-copy").unbind("click").click(function () {
            var fullPath = buildPath(folder.text(), side);
            var dest = buildPath($("#path_col01").val(), side);
            folderActionCopy(fullPath, dest, side);
            });

            $find(".hdwfm-file-explorer-bottom-move").unbind("click").click(function () {
            var fullPath = buildPath(folder.text(), side);
            folderActionRenameMove(fullPath, side);
            });

            $find(".hdwfm-file-explorer-bottom-delete").unbind("click").click(function () {
            if (confirm("Do you realy want to delete " + folder.text() + "?")) {
            var fullPath = buildPath(folder.text(), side);
            folderActionDelete(fullPath, side);
            }
            });*/
        }

        function buildLineNumber(nrOfLines) {
            var linesMarkup = '';
            for (var no = 1; no < nrOfLines; no++) {
                if (linesMarkup.length > 0) {
                    linesMarkup += '<br>';
                }
                linesMarkup += no;
            }
            $(".hdwfm-file-editor-content-rownumber").html(linesMarkup);
        }

        function urlEncode(str) {
            str = (str + '').toString();
            return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');
        }

        function getFileName(filePath) {
            if (filePath) {
                var m = filePath.toString().match(/.*\/(.+?)\./);
                if (m && m.length > 1) {
                    return m[1];
                }
            }
            return "";
        }

        // jquery.upload
        (function ($) {
            var uuid = 0;
            $.fn.upload = function (url, data, callback, type) {
                var self = this, inputs, checkbox, checked,
			iframeName = 'jquery_upload' + ++uuid,
			iframe = $('<iframe name="' + iframeName + '" style="position:absolute;top:-9999px" />').appendTo('body'),
			form = '<form target="' + iframeName + '" method="post" enctype="multipart/form-data" />';

                if ($.isFunction(data)) {
                    type = callback;
                    callback = data;
                    data = {};
                }
                checkbox = $('input:checkbox', this);
                checked = $('input:checked', this);
                form = self.wrapAll(form).parent('form').attr('action', url);

                // Make sure radios and checkboxes keep original values
                // (IE resets checkd attributes when appending)
                checkbox.removeAttr('checked');
                checked.attr('checked', true);

                inputs = createInputs(data);
                inputs = inputs ? $(inputs).appendTo(form) : null;

                form.submit(function () {
                    iframe.load(function () {
                        var data = handleData(this, type),
					checked = $('input:checked', self);

                        form.after(self).remove();
                        checkbox.removeAttr('checked');
                        checked.attr('checked', true);
                        if (inputs) {
                            inputs.remove();
                        }
                        setTimeout(function () {
                            iframe.remove();
                            if (type === 'script') {
                                $.globalEval(data);
                            }
                            if (callback) {
                                callback.call(self, data);
                            }
                        }, 0);
                    });
                }).submit();
                return this;
            };

            function createInputs(data) {
                return $.map(param(data), function (param) {
                    return '<input type="hidden" name="' + param.name + '" value="' + param.value + '"/>';
                }).join('');
            }

            function param(data) {
                if ($.isArray(data)) {
                    return data;
                }
                var params = [];

                function add(name, value) {
                    params.push({ name: name, value: value });
                }

                if (typeof data === 'object') {
                    $.each(data, function (name) {
                        if ($.isArray(this)) {
                            $.each(this, function () {
                                add(name, this);
                            });
                        } else {
                            add(name, $.isFunction(this) ? this() : this);
                        }
                    });
                } else if (typeof data === 'string') {
                    $.each(data.split('&'), function () {
                        var param = $.map(this.split('='), function (v) {
                            return decodeURIComponent(v.replace(/\+/g, ' '));
                        });

                        add(param[0], param[1]);
                    });
                }

                return params;
            }

            function handleData(iframe, type) {
                var data, contents = $(iframe).contents().get(0);

                if ($.isXMLDoc(contents) || contents.XMLDocument) {
                    return contents.XMLDocument || contents;
                }
                data = $(contents).find('body').html();

                switch (type) {
                    case 'xml':
                        data = parseXml(data);
                        break;
                    case 'json':
                        data = window.eval('(' + data + ')');
                        break;
                }
                return data;
            }

            function parseXml(text) {
                if (window.DOMParser) {
                    return new DOMParser().parseFromString(text, 'application/xml');
                } else {
                    var xml = new ActiveXObject('Microsoft.XMLDOM');
                    xml.async = false;
                    xml.loadXML(text);
                    return xml;
                }
            }

        })(jQuery);
        // end jquery.upload


        function logEvent(logMessage) {
            try {
                $(".hdwfm-logger").val(printFriendlyDate() + "- " + logMessage + "\r\n" + $(".hdwfm-logger").val());
            } catch (e) { }
        }

        function downloadFile(fileName) {
            window.open(hdDataProviderURL + "?dl=1&fn=" + urlEncode(fileName));
        }

        function printFriendlyDate() {
            var cd = new Date()
            var rezultat = cd.getHours();
            var mins = cd.getMinutes();
            var secs = cd.getSeconds()
            if (mins > 9)
                rezultat += ":" + mins;
            else
                rezultat += ":0" + mins;
            if (secs > 9)
                rezultat += ":" + secs;
            else
                rezultat += ":0" + secs;

            return rezultat;
        }

        // ***********************
        // event asignation methods
        function assignEvents(side) {

            // * * * * * * * text editor line number events * * * * * * * 
            var ta = $(".hdwfm-file-editor-textarea");
            var lineObj = $(".hdwfm-file-editor-content-rownumber");

            $(ta).unbind("keydown").keydown(function () { positionLineObj(lineObj, ta); });
            $(ta).unbind("mousedown").mousedown(function () { positionLineObj(lineObj, ta); });
            $(ta).unbind("scroll").scroll(function () { positionLineObj(lineObj, ta); });
            $(ta).unbind("blur").blur(function () { positionLineObj(lineObj, ta); });
            $(ta).unbind("focus").focus(function () { positionLineObj(lineObj, ta); });
            $(ta).unbind("mouseover").mouseover(function () { positionLineObj(lineObj, ta); });
            // * * * * * * * END * * * * * * *

            var s = "1";
            if (side == "left") {
                s = "1";
            }
            else {
                s = "2";
            }

            // refresh drives
            $(".hdwfm-explorer-header-col0" + s + " .hdwfm-file-explorer-header-refresh-drives").unbind("click").click(function () {
                getDiskDrivesList(side);
            });

            // goto parent
            $(".hdwfm-explorer-header-col0" + s + " .hdwfm-file-explorer-header-goto-path").unbind("click").click(function () {
                var path = $("#path_col0" + s + "").val().replace(/\\/g, "/");
                getDirContent(getPathWithEndTrail(path), side);
            });

            // goto parent
            $(".hdwfm-explorer-header-col0" + s + " .hdwfm-file-explorer-header-goto-parent").unbind("click").click(function () {
                getDirContent(getParentPath(side), side);
            });

            // goto root
            $(".hdwfm-explorer-header-col0" + s + " .hdwfm-file-explorer-header-goto-root").unbind("click").click(function () {
                getDirContent(getRootPath(side), side);
            });

            // goto this file's folder
            $(".hdwfm-explorer-header-col0" + s + " .hdwfm-file-explorer-header-goto-this-items-folder").unbind("click").click(function () {
                getThisFilesFolder(side);
            });

            // upload file
            $(".hdwfm-explorer-header-col0" + s + " .hdwfm-file-explorer-header-upload").unbind("click").click(function () {
                showUploaderPanel(side);
            });

            // create new file
            $(".hdwfm-explorer-header-col0" + s + " .hdwfm-file-explorer-header-new-file").unbind("click").click(function () {
                showCreateNewItemPanel('file', side);
            });

            // create new folder
            $(".hdwfm-explorer-header-col0" + s + " .hdwfm-file-explorer-header-new-folder").unbind("click").click(function () {
                showCreateNewItemPanel('folder', side);
            });

            // text editor - save
            $(".hdwfm-file-editor .hdwfm-file-editor-btn-save").unbind("click").click(function () {
                var filePath = $(".hdwfm-file-editor .hdwfm-file-editor-header .hdwfm-editing-file").text();
                var content = $(".hdwfm-file-editor .hdwfm-file-editor-content-editor .hdwfm-file-editor-textarea").val();
                saveFileContent(filePath, content);
            });

            // text editor - cancel
            $(".hdwfm-file-editor .hdwfm-file-editor-btn-cancel").unbind("click").click(function () {
                hideFileEditor();
            });

            //recycle application
            $(".hdwfm-file-explorer-bottom-recycle").unbind("click").click(function () {
                recycleAppPool();
            });

            // log window show
            $(".hdwfm-file-explorer-bottom-show-logs").unbind("click").click(function () {
                showLogsWindos();
            });

            // log window hide
            $(".hdwfm-log-header-close").unbind("click").click(function () {
                hideLogsWindos();
            });
        }

        function assignUploadPopupButtonsEvent(side) {
            // upload file
            $(".hdwfm-file-upload-file").unbind("click").click(function () {
                uploadFile(side);
            });
        }

        function assignRenameMovePopupButtonsEvent(itemsType, side) {
            // rename file
            $(".hdwfm-renamer-popup-action-rename").unbind("click").click(function () {
                var itemOldPath = $(".hdwfm-renamer-popup .hdwfm-renamer-popup-rename-from .hdwfm-renamer-popup-file-name").val();
                var itemNewPath = $(".hdwfm-renamer-popup .hdwfm-renamer-popup-rename-to .hdwfm-renamer-popup-new-name").val();
                if (itemsType == 'file') {
                    renameMoveFile(itemOldPath, itemNewPath, side);
                } else if (itemsType == 'folder') {
                    renameMoveFolder(itemOldPath, itemNewPath, side);
                }
            });
        }

        function assignCopyPopupButtonsEvent(itemsType, side) {
            // copy file or folder
            $(".hdwfm-copy-popup-action-copy").unbind("click").click(function () {
                var itemOldPath = $(".hdwfm-copy-popup .hdwfm-copy-popup-copy-from .hdwfm-copy-popup-file-name").val();
                var itemNewPath = $(".hdwfm-copy-popup .hdwfm-copy-popup-copy-to .hdwfm-copy-popup-new-name").val();
                if (itemsType == 'file') {
                    copyFile(itemOldPath, itemNewPath, side);
                } else if (itemsType == 'folder') {
                    copyFolder(itemOldPath, itemNewPath, side);
                }
            });
        }

        function assignNewItemPopupButtonEvents(itemType, path, side) {
            $('.hdwfm-new-item .hdwfm-new-item-footer .hdwfm-new-item-action').unbind('click').click(function () {
                var itemValue = $('.hdwfm-new-item .hdwfm-new-item-content input').val();
                if (itemValue != '') {
                    createEmptyItem(path + itemValue, itemType, side);
                }
            });
        }

        function assignDriveChangeClickEvent(side) {
            if (side == "left") {
                $(".hdwfm-explorer-header-col01 .hdwfm-file-explorer-header-drives").unbind("change").change(function () {
                    getDirContent($(this).val() + ":/", side);
                });
            }
            else {
                $(".hdwfm-explorer-header-col02 .hdwfm-file-explorer-header-drives").unbind("change").change(function () {
                    getDirContent($(this).val() + ":/", side);
                });
            }
        }

        function assignItemsClickEvents(side) {
            var s = "2";
            if (side == "left")
                s = "1";

            var folders = $(".hdwfm-explorer-col0" + s + " .hdwfm-file-explorer-row .hdwfm-row-col03 span.hdwfm-folder");
            var files = $(".hdwfm-explorer-col0" + s + " .hdwfm-file-explorer-row .hdwfm-row-col03 span.hdwfm-file");
            // asign the right click event
            folders.showMenu({
                opacity: 0.8,
                query: ".hdwfm-menu-folder",
                side: side
            });

            files.showMenu({
                opacity: 0.8,
                query: ".hdwfm-menu-file",
                side: side
            });


            folders.unbind("click").click(function () {
                folderClick($(this).text(), side);
            });

            //files.unbind("click").click(function () {
            //  fileClick($(this).text(), side);
            //});

        }

        function assignRightClickMenuItemsEvents(popupMenu, folder, side) {
            //****************************************
            // folder 
            // copy
            $(popupMenu).find(".hdwfm-menu-folder-action-copy").unbind("click").click(function () {
                var fullPath = buildPath(folder.text(), side);
                var dest = buildPath($("#path_col01").val(), side);
                folderActionCopy(fullPath, dest, side);
            });

            // rename
            $(popupMenu).find(".hdwfm-menu-folder-action-rename").unbind("click").click(function () {
                var fullPath = buildPath(folder.text(), side);
                folderActionRenameMove(fullPath, side);
            });

            // delete
            $(popupMenu).find(".hdwfm-menu-folder-action-delete").unbind("click").click(function () {
                if (confirm("Do you realy want to delete " + folder.text() + "?")) {
                    var fullPath = buildPath(folder.text(), side);
                    folderActionDelete(fullPath, side);
                }
            });

            // download
            $(popupMenu).find(".hdwfm-menu-folder-action-download").unbind("click").click(function () {
                var fullPath = buildPath(folder.text(), side);
                folderActionDownload(fullPath);
            });

            // archive
            $(popupMenu).find(".hdwfm-menu-folder-action-archive").unbind("click").click(function () {
                var fullPath = buildPath(folder.text(), side);
                folderActionArchive(fullPath);
            });

            //****************************************
            // file
            // edit
            $(popupMenu).find(".hdwfm-menu-file-action-edit").unbind("click").click(function () {
                var fullPath = buildPath(folder.text(), side);
                fileActionEdit(fullPath);
            });

            // rename
            $(popupMenu).find(".hdwfm-menu-file-action-rename").unbind("click").click(function () {
                var fullPath = buildPath(folder.text(), side);
                fileActionRenameMove(fullPath, side);
            });

            // copy
            $(popupMenu).find(".hdwfm-menu-file-action-copy").unbind("click").click(function () {
                var fullPath = buildPath(folder.text(), side);
                var dest = "";
                if (side == "left")
                    dest = $("#path_col02").val();
                else dest = $("#path_col01").val();

                fileActionCopy(fullPath, dest, side);
            });

            // delete
            $(popupMenu).find(".hdwfm-menu-file-action-delete").unbind("click").click(function () {
                if (confirm("Do you realy want to delete " + folder.text() + "?")) {
                    var fullPath = buildPath(folder.text(), side);
                    fileActionDelete(fullPath, side);
                }
            });

            // downlaod
            $(popupMenu).find(".hdwfm-menu-file-action-download").unbind("click").click(function () {
                var fullPath = buildPath(folder.text(), side);
                fileActionDownload(fullPath);
            });

            // run
            $(popupMenu).find(".hdwfm-menu-file-action-run").unbind("click").click(function () {
                var fullPath = buildPath(folder.text(), side);
                fileActionRun(fullPath);
            });

            // archive
            $(popupMenu).find(".hdwfm-menu-file-action-archive").unbind("click").click(function () {
                var fullPath = buildPath(folder.text(), side);
                fileActionArchive(fullPath);
            });

            // unarchive
            $(popupMenu).find(".hdwfm-menu-file-action-unarchive").unbind("click").click(function () {
                var fullPath = buildPath(folder.text(), side);
                fileActionUnArchive(fullPath, '');
            });
        }

        // ***********************
        // click handlers methods
        function folderClick(folderName, side) {
            logEvent('Folder click( ' + folderName + ', ' + side + ')');
            getDirContent(buildPath(folderName, side), side);
        }

        function fileClick(fileName, side) {
            logEvent('File click( ' + fileName + ', ' + side + ')');
            getFileContent(buildPath(fileName, side));
        }

        // ***********************
        // path manipulation metehods
        function buildPath(path, side) {
            var rezultat = '';
            if (side == "left") {
                rezultat = hdLeftSidePath;
            }
            else {
                rezultat = hdRightSidePath;
            }
            return getPathWithEndTrail(rezultat) + path;
        }

        function getPathWithEndTrail(path) {
            if (path.endsWith("/")) {
                return path;
            }
            else {
                return path + "/";
            }
        }

        function getParentPath(side) {
            var path = getRootPathBasedOnSide(side);

            path = getPathWithEndTrail(path);
            var items = path.split("/");
            var rezultat = '';
            if (items.length > 2) {
                for (var i = 0; i < items.length - 2; i++) {
                    rezultat += items[i] + '/';
                }
                return rezultat;
            }
            else {
                return path;
            }
        }

        function getRootPath(side) {
            var path = getRootPathBasedOnSide(side);
            path = getPathWithEndTrail(path);
            return path.substr(0, path.indexOf("/", 0) + 1);
        }

        function getRootPathBasedOnSide(side) {
            if (side == 'left') {
                rootPath = hdLeftSidePath;
            }
            else {
                rootPath = hdRightSidePath;
            }
            return rootPath;
        }

        // ***********************
        // ajax methods

        function getDirContent(path, side) {
            logEvent('AJAX: get Dir Content( ' + path + ', ' + side + ')');
            $.ajax({
                type: "POST",
                url: hdDataProviderURL + "/WSGetFolder",
                data: "{ folder : '" + path + "', searchPattern: '*.*' }",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    logEvent('AJAX: get Dir Content - success');
                    if (msg.d.Error != null) {
                        alert(msg.d.Error);
                    }
                    else {
                        buildTheFolderStructure(msg.d, side);
                    }
                },
                error: function (httpRequest, txtStatus, errThrown) {
                    alert("httpReq: " + httpRequest + "\r\ntxtStatus: " + txtStatus + "\r\nerrThrown: " + errThrown);
                }
            });
        }

        function getDiskDrivesList(side) {
            logEvent('AJAX: get Disk Drives List(' + side + ')');
            $.ajax({
                type: "POST",
                url: hdDataProviderURL + "/WSGetDiskDrives",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    logEvent('AJAX: get Disk Drives List - success');
                    buildDiskDrives(msg.d, side);
                }
            });
        }

        function getThisFilesFolder(side) {
            logEvent('AJAX: get This Files Folder(' + side + ')');
            $.ajax({
                type: "POST",
                url: hdDataProviderURL + "/WSThisFilesFolder",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    logEvent('AJAX: get This Files Folder - success');
                    getDirContent(msg.d, side);
                }
            });
        }

        function getFileContent(filePath) {
            logEvent('AJAX: get File Content(' + filePath + ')');
            $.ajax({
                type: "GET",
                url: hdDataProviderURL,
                data: { c: 'getFileContent', fn: urlEncode(filePath) },
                contentType: "application/json; charset=utf-8",
                dataType: "text",
                success: function (msg) {
                    logEvent('AJAX: get File Content - success');

                    showFileEditor(filePath, msg);
                },
                error: function (httpRequest, txtStatus, errThrown) {
                    alert("httpReq: " + httpRequest.responseText + "\r\ntxtStatus: " + txtStatus + "\r\nerrThrown: " + errThrown);
                }
            });
        }

        function saveFileContent(filePath, content) {
            logEvent('AJAX: save File Content(' + filePath + ')');
            $.ajax({
                type: "POST",
                url: hdDataProviderURL,
                data: { c: "saveFileContent", fn: urlEncode(filePath), cntnt: content },
                dataType: "text",
                success: function (msg) {
                    logEvent('AJAX: save File Content - success' + msg);
                },
                error: function (httpRequest, txtStatus, errThrown) {
                    alert("httpReq: " + httpRequest.responseText + "\r\ntxtStatus: " + txtStatus + "\r\nerrThrown: " + errThrown);
                }
            });
        }

        function deleteFile(filePath, side) {
            logEvent('AJAX: delete File(' + filePath + ')');
            $.ajax({
                type: "POST",
                url: hdDataProviderURL + "/WSDeleteFile",
                data: "{ filePath: '" + filePath + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    if (msg.d.Error != null) {
                        logEvent('AJAX: delete File - success : ' + msg.d.Error);
                        alert(msg.d.Error);
                    }
                    else {
                        logEvent('AJAX: delete File - success - ' + msg.d.Raspuns.toString().toUpperCase());
                    }
                }
            });
        }

        function runFile(filePath) {
            logEvent('AJAX: run File(' + filePath + ')');
            $.ajax({
                type: "POST",
                url: hdDataProviderURL + "/WSRunExe",
                data: '{ filePath: "' + filePath + '", arguments: "" }',
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    if (msg.d.Error != null) {
                        logEvent('AJAX: run file - success : ' + msg.d.Error);
                        alert(msg.d.Error);
                    }
                    else {
                        logEvent('AJAX: run file - success - ' + msg.d.Raspuns.toString().toUpperCase());
                    }
                }
            });
        }

        function uploadFile(side) {
            var destPath = $('.hdwfm-file-uploader .hdwfm-file-uploader-header .hdwfm-fu-header-upload-path').text();
            $(".hdwfm-file-uploader .hdwfm-file-uploader-content span").text("uploading ...");
            logEvent('AJAX: upload File');
            $(".hdwfm-file-file-input").upload(hdDataProviderURL, { destPath: destPath }, function (resp) {
                logEvent(resp);
                $(".hdwfm-file-uploader .hdwfm-file-uploader-content span").text("Done uploading!");
            }, 'text');
        }

        function copyFile(filePath, newFilePath, side) {
            logEvent('AJAX: copy File');
            $.ajax({
                type: "POST",
                url: hdDataProviderURL + "/WSCopyFile",
                data: "{ fileOldPath: '" + filePath + "', fileNewPath: '" + newFilePath + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    if (msg.d.Error != null) {
                        logEvent('AJAX: copy File - success : ' + msg.d.Error);
                        alert(msg.d.Error);
                    }
                    else {
                        logEvent('AJAX: copy File - success - ' + msg.d.Raspuns.toString().toUpperCase());
                    }
                }
            });
        }

        function copyFolder(folderOldPath, folderNewPath, side) {
            logEvent('AJAX: copy Folder');
            $.ajax({
                type: "POST",
                url: hdDataProviderURL + "/WSCopyFolder",
                data: "{ folderOldPath: '" + folderOldPath + "', folderNewPath: '" + folderNewPath + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    if (msg.d.Error != null) {
                        logEvent('AJAX: copy Folder - success : ' + msg.d.Error);
                        alert(msg.d.Error);
                    }
                    else {
                        logEvent('AJAX: copy Folder - success - ' + msg.d.Raspuns.toString().toUpperCase());
                    }
                }
            });
        }
     
        function renameMoveFile(filePath, newFilePath, side) {
            logEvent('AJAX: rename/move File');
            $.ajax({
                type: "POST",
                url: hdDataProviderURL + "/WSRenameMoveFile",
                data: "{ fileOldPath: '" + filePath + "', fileNewPath: '" + newFilePath + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    if (msg.d.Error != null) {
                        logEvent('AJAX: rename/move File - success : ' + msg.d.Error);
                        alert(msg.d.Error);
                    }
                    else {
                        logEvent('AJAX: rename/move File - success - ' + msg.d.Raspuns.toString().toUpperCase());
                    }
                }
            });
        }

        function renameMoveFolder(folderOldPath, folderNewPath, side) {
            logEvent('AJAX: rename/move Folder');
            $.ajax({
                type: "POST",
                url: hdDataProviderURL + "/WSRenameMoveFolder",
                data: "{ folderOldPath: '" + folderOldPath + "', folderNewPath: '" + folderNewPath + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    if (msg.d.Error != null) {
                        logEvent('AJAX: rename/move Folder - success : ' + msg.d.Error);
                        alert(msg.d.Error);
                    }
                    else {
                        logEvent('AJAX: rename/move Folder - success - ' + msg.d.Raspuns.toString().toUpperCase());
                    }
                }
            });
        }

        function recycleAppPool() {
            logEvent('AJAX: trying recycle app pool');
            $.ajax({
                type: "POST",
                url: hdDataProviderURL + "/WSRecycleAppPool",
                contentType: "application/json; charset=utf-8",
                dataType: "json"
            });
        }

        function deleteFolder(folderPath, side) {
            logEvent('AJAX: delete Folder(' + folderPath + ')');
            $.ajax({
                type: "POST",
                url: hdDataProviderURL + "/WSDeleteFolder",
                data: "{ folderPath: '" + folderPath + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    if (msg.d.Error != null) {
                        logEvent('AJAX: delete Folder - success : ' + msg.d.Error);
                        alert(msg.d.Error);
                    }
                    else {
                        logEvent('AJAX: delete Folder - success - ' + msg.d.Raspuns.toString().toUpperCase());
                    }
                }
            });
        }

        function createEmptyItem(itemPath, itemType, side) {
            logEvent('AJAX: create Empty item(' + itemPath + ')');
            $.ajax({
                type: "POST",
                url: hdDataProviderURL + "/WSCreateEmptyItem",
                data: "{ itemPath: '" + itemPath + "', itemType: '" + itemType + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    if (msg.d.Error != null) {
                        logEvent('AJAX: create empty item - success : ' + msg.d.Error);
                        alert(msg.d.Error);
                    }
                    else {
                        logEvent('AJAX: create Empty item - success - ' + msg.d.Raspuns.toString().toUpperCase());
                        hidePopupPanel();
                    }
                }
            });
        }

        // ***********************
        // data processing methods
        function buildTheFolderStructure(data, side) {
            var markup = '';

            if (data != null &&
                data.ItemsList != null &&
                data.ItemsList.length > 0) {
                for (var i = 0; i < data.ItemsList.length; i++) {
                    var itemType = '';
                    if (data.ItemsList[i].ItemType == 1) {
                        itemType = 'folder';
                    }
                    else {
                        itemType = 'file';
                    }

                    markup += '<div class="hdwfm-file-explorer-row"> ' +
                                '<div class="hdwfm-file-explorer-row-margin hdwfm-margin-left">' +
                                '</div>' +
                                '<div class="hdwfm-file-explorer-row-col hdwfm-row-col01">' +
                                    '<input type="checkbox" />' +
                                '</div>' +
                                '<div class="hdwfm-file-explorer-row-col hdwfm-row-col02">' +
                                    '<div title="' + itemType + '" class="hdwfm-file-explorer-item-type hdwfm-' + itemType + '">' +
                                    '</div>' +
                                '</div>' +
                                '<div class="hdwfm-file-explorer-row-col hdwfm-row-col03">' +
                                    '<span class="hdwfm-' + itemType + '" title="' + data.ItemsList[i].Name + '">' + data.ItemsList[i].Name + '</span>' +
                                '</div>' +
                                '<div class="hdwfm-file-explorer-row-col hdwfm-row-col04">' +
                                '  <span >' + readablizeBytes(data.ItemsList[i].Size) + '</span>' +
                                '</div>' +
                                '<div class="hdwfm-file-explorer-row-col hdwfm-row-col05">' +
                                '    <div class="hdwfm-file-explorer-created-date">C: ' + data.ItemsList[i].CreatedDate + '</div>' +
                                '    <div class="hdwfm-file-explorer-modified-date">M: ' + data.ItemsList[i].LastAccessTime + '</div>' +
                                '</div>' +
                                '<div class="hdwfm-file-explorer-row-margin hdwfm-margin-right">' +
                                '</div>' +
                            '</div>'
                }
            }
            if (side == 'left') {
                hdLeftSidePath = data.rootPath;
                $(".hdwfm-file-explorer-col.hdwfm-explorer-col01").html(markup);
                $("#path_col01").val(data.rootPath);
            }
            else {
                hdRightSidePath = data.rootPath;
                $(".hdwfm-file-explorer-col.hdwfm-explorer-col02").html(markup);
                $("#path_col02").val(data.rootPath);
            }

            assignItemsClickEvents(side);
        }

        function buildDiskDrives(data, side) {
            var markup = "";
            for (var i = 0; i < data.DrivesList.length; i++) {
                var itm = data.DrivesList[i];
                markup += "<option value='" + itm.DriveName + "'>" + itm.DriveName + ": [" + itm.DiskLabel + "] " + readablizeBytes(itm.DiskFreeSpace) + "/" + readablizeBytes(itm.DiskTotalSpace) + " |" + itm.DriveType + "|</option>";
            }
            if (side == 'left') {
                $(".hdwfm-explorer-header-col01 .hdwfm-file-explorer-header-drives").html(markup);
            }
            else {
                $(".hdwfm-explorer-header-col02 .hdwfm-file-explorer-header-drives").html(markup);
            }
            assignDriveChangeClickEvent(side);
        }

        // ***********************
        // folder manipulation methods
        function folderActionCopy(sourcePath, destPath, side) {
            logEvent('folderActionCopy(' + sourcePath + ', ' + destPath + ')');
            showCopyPopup('folder', sourcePath, destPath, side);
            //alert("copy: " + sourcePath);
        }

        function folderActionRenameMove(folderPath, side) {
            logEvent('folderActionRenameMove(' + folderPath + ')');
            showRenamerMoverPopup('folder', folderPath, side);
        }

        function folderActionDelete(folderPath, side) {
            logEvent('folderActionDelete(' + folderPath + ')');
            deleteFolder(folderPath, side);
        }

        function folderActionDownload(folderPath) {
            logEvent('folderActionDownload(' + folderPath + ')');
            alert("Download: " + folderPath);
        }

        function folderActionArchive(sourcePath, destPath) {
            logEvent('folderActionArchive(' + sourcePath + ', ' + destPath + ')');
            alert("Archive: " + sourcePath);
        }

        // ***********************
        // file manipulation methods
        function fileActionEdit(filePath) {
            logEvent('fileActionEdit(' + filePath + ')');
            getFileContent(filePath);
        }

        function fileActionRenameMove(filePath, side) {
            logEvent('fileActionRenameMove(' + filePath + ')');
            showRenamerMoverPopup('file', filePath, side);
        }

        function fileActionCopy(sourcePath, destPath, side) {
            logEvent('fileActionCopy(' + sourcePath + ', ' + destPath + ')');
            showCopyPopup('file', sourcePath, destPath, side);
        }

        function fileActionDelete(filePath, side) {
            logEvent('fileActionDelete(' + filePath + ')');
            deleteFile(filePath, side);
        }

        function fileActionDownload(filePath) {
            logEvent('fileActionDownload(' + filePath + ')');
            downloadFile(filePath);
        }

        function fileActionRun(filePath) {
            runFile(filePath);
        }

        function fileActionArchive(filePath) {
            logEvent('fileActionArchive(' + filePath + ')');
            alert("file Archive: " + filePath);
        }

        function fileActionUnArchive(sourcePath, destPath) {
            logEvent('fileActionUnArchive(' + sourcePath + ', ' + destPath + ')');
            //alert("file UnArchive: " + sourcePath);            
        }


        // ***********************
        // content visibility manipulation
        function showFileEditor(fileName, fileContent) {
            $(".hdwfm-file-editor .hdwfm-file-editor-header .hdwfm-editing-file").text(fileName);
            $(".hdwfm-file-editor").show();
            $(".hdwfm-file-editor .hdwfm-file-editor-textarea").val(fileContent);
        }

        function hideFileEditor() {
            $(".hdwfm-file-editor").hide();
            $(".hdwfm-file-editor .hdwfm-file-editor-textarea").val('');
        }

        function showLogsWindos() {
            $(".hdwfm-log-container").show();
        }

        function hideLogsWindos() {
            $(".hdwfm-log-container").hide();
        }

        function showUploaderPanel(side) {
            // assign click events
            assignUploadPopupButtonsEvent(side);

            // clear the status label
            $("#fileInput").val('');
            $(".hdwfm-file-uploader .hdwfm-file-uploader-content span").text('');
            // set the destination path
            $('.hdwfm-file-uploader .hdwfm-file-uploader-header .hdwfm-fu-header-upload-path').text(getRootPathBasedOnSide(side)).attr("title", getRootPathBasedOnSide(side));
            $.blockUI({
                message: $('.hdwfm-file-uploader'),
                css: { width: 235, 'text-align': 'left' }
            });
            $('.blockOverlay').attr('title', 'Click to unblock').unbind('click').click($.unblockUI);
        }

        function showCreateNewItemPanel(itemType, side) {
            var path = getPathWithEndTrail(getRootPathBasedOnSide(side));
            assignNewItemPopupButtonEvents(itemType, path, side);
            $('.hdwfm-new-item .hdwfm-new-item-content input').val('');
            $('.hdwfm-new-item .hdwfm-ni-header').html('Create new ' + itemType + ':');
            $('.hdwfm-new-item .hdwfm-ni-header-path').html(path);
            $.blockUI({
                message: $('.hdwfm-new-item'),
                css: { width: 235, 'text-align': 'left' }
            });
            $('.blockOverlay').attr('title', 'Click to unblock').unbind('click').click($.unblockUI);
        }

        function showRenamerMoverPopup(itemsType, itemPath, side) {
            assignRenameMovePopupButtonsEvent(itemsType, side);
            $(".hdwfm-renamer-popup .hdwfm-renamer-popup-rename-from .hdwfm-renamer-popup-file-name").attr("title", itemPath).val(itemPath);
            $(".hdwfm-renamer-popup .hdwfm-renamer-popup-rename-to .hdwfm-renamer-popup-new-name").val(itemPath);
            $.blockUI({
                message: $(".hdwfm-renamer-popup"),
                css: { width: 235, 'text-align': 'left' }
            });
            $('.blockOverlay').attr('title', 'Click to unblock').unbind('click').click($.unblockUI);
            $(".hdwfm-renamer-popup .hdwfm-renamer-popup-rename-to .hdwfm-renamer-popup-new-name").focus();
        }

        function showCopyPopup(itemsType, sourcePath, destPath, side) {
            assignCopyPopupButtonsEvent(itemsType, side);
            $(".hdwfm-copy-popup .hdwfm-copy-popup-copy-from .hdwfm-copy-popup-file-name").attr("title", sourcePath).val(sourcePath);
            $(".hdwfm-copy-popup .hdwfm-copy-popup-copy-to .hdwfm-copy-popup-new-name").val(destPath);
            $.blockUI({
                message: $(".hdwfm-copy-popup"),
                css: { width: 235, 'text-align': 'left' }
            });
            $('.blockOverlay').attr('title', 'Click to unblock').unbind('click').click($.unblockUI);
            $(".hdwfm-copy-popup .hdwfm-copy-popup-copy-to .hdwfm-copy-popup-new-name").focus();
        }

        function hidePopupPanel() {
            $.unblockUI();
        }

        function showNotificationMessage(titlu, msg) {
            $.growlUI(titlu, msg);
        }

        // ***********************
        // document ready
        $(document).ready(function () {
            try {
                createRClickMenu();
                // decomenteaza linia asta ca sa aduca continutul folderului
                //getDirContent('d:/Kituri/', 'left');
                //assignMenuEvents();
                getDiskDrivesList('left');
                getDiskDrivesList('right');
                buildLineNumber(1000);
                assignEvents('left');
                assignEvents('right');
            } catch (e) {
                logEvent("document.ready exeption: " + e.Message);
            }
        });

    </script>
    <%-- ************ SERVER SIDE ************ --%>
    <script runat="server">
    </script>
    <style type="text/css">
        input.hdwfm-text
        {
            border: 0 none;
            font-family: monospace;
            font-size: 11px;
        }
        
        .hdwfm-file-explorer
        {
            background-color: #eeeeee;
            margin: 0 auto;
            width: 900px;
        }
        .hdwfm-file-explorer-bottom, .hdwfm-file-explorer-header
        {
            background-color: silver;
            height: 20px;
        }
        .hdwfm-file-explorer-bottom .hdwfm-file-explorer-bottom-show-logs
        {
            background-color: lightCoral;
            color: black;
            display: block;
            float: right;
            font-size: 12px;
            height: 20px;
            padding: 0 4px;
            text-decoration: none;
            width: 20px;
        }
        .hdwfm-file-explorer-content
        {
            height: 400px;
        }
        .hdwfm-file-explorer-header-col
        {
            background-color: #999999;
            height: 100%;
            width: 449px;
            display: block;
            float: left;
            overflow: auto;
        }
        .hdwfm-file-explorer-header-col label
        {
            display: block;
            float: left;
            font-size: 12px;
            margin: 2px 0 0 2px;
        }
        /*.hdwfm-file-explorer-header-col input { border: 0 none; display: block; float: left; font-family: monospace; font-size: 11px; margin: 2px 0 0 5px; width: 252px; }*/
        .hdwfm-file-explorer-header-col input
        {
            display: block;
            float: left;
            margin: 2px 0 0 5px;
            width: 211px;
        }
        .hdwfm-file-explorer-header-goto-links
        {
            display: block;
            float: left;
            background-color: lightGrey;
            font-family: Monospace;
            font-size: 14px;
            height: 18px;
            width: 18px;
            -moz-border-radius: 2px 2px 2px 2px;
            text-align: center;
            vertical-align: middle;
            margin: 1px 0pt 0pt 3px;
            text-decoration: none;
            color: black;
        }
        .hdwfm-file-explorer-header-goto-path
        {
            font-family: Monospace;
        }
        .hdwfm-file-explorer-header-drives
        {
            border-style: hidden;
            display: block;
            float: left;
            font-size: 10px;
            margin: 3px 0 0 2px;
            width: 35px;
        }
        .hdwfm-file-explorer-col
        {
            background-color: #CCCCCC;
            height: 100%;
            width: 449px;
            display: block;
            float: left;
            overflow: auto;
        }
        .hdwfm-explorer-header-col02, .hdwfm-explorer-col02
        {
            margin-left: 2px;
        }
        .hdwfm-file-explorer-row
        {
            height: 21px;
            margin-bottom: 1px;
        }
        .hdwfm-file-explorer-row-margin
        {
            background-color: white;
            display: block;
            float: left;
            height: 100%;
            width: 2px;
        }
        /*.hdwfm-file-explorer-row-col { background-color: #FFA000; display: block; height: 21px; float: left; margin-left: 1px; margin-top: 1px; }*/
        .hdwfm-file-explorer-row-col
        {
            background-color: #DDDDDD;
            display: block;
            height: 21px;
            float: left;
            margin-left: 1px;
            margin-top: 1px;
        }
        .hdwfm-row-col03
        {
            width: 243px;
        }
        .hdwfm-row-col03 span
        {
            cursor: pointer;
        }
        .hdwfm-row-col03 span:hover
        {
            text-decoration: underline;
            color: darkblue;
        }
        .hdwfm-row-col03 .hdwfm-folder
        {
        }
        .hdwfm-row-col03 .hdwfm-file
        {
        }
        .hdwfm-row-col04
        {
            width: 60px;
        }
        .hdwfm-row-col04 span
        {
            float: right;
            padding-right: 2px;
            padding-top: 2px;
        }
        .hdwfm-row-col05
        {
            width: 79px;
            overflow: hidden;
        }
        .hdwfm-row-col05 div
        {
            float: right;
            font-family: sans-serif;
            font-size: 8px;
            margin-right: 2px;
        }
        .hdwfm-row-col06
        {
            width: 74px;
        }
        .hdwfm-row-col06 a
        {
            background-color: #F5DEB3;
            display: block;
            float: left;
            font-size: 10px;
            height: 13px;
            margin-left: 4px;
            margin-top: 4px;
            text-align: center;
            width: 10px;
        }
        .hdwfm-file-explorer-row-col span
        {
            display: block;
            font-size: 14px;
            height: 19px;
            margin: auto auto auto 2px;
            overflow: hidden;
        }
        .hdwfm-file-explorer-item-type
        {
            height: 13px;
            margin: 4px;
            width: 13px;
        }
        .hdwfm-file-explorer-item-type.hdwfm-folder
        {
            background-color: yellow;
        }
        .hdwfm-file-explorer-item-type.hdwfm-file
        {
            background-color: #74d535;
        }
        
        .hdwfm-file-editor
        {
            display: none;
            left: 0;
            margin: 0 auto;
            position: absolute;
            right: 0;
            top: 10px;
            width: 700px;
        }
        .hdwfm-file-editor-header
        {
            height: 20px;
            background-color: Gray;
        }
        .hdwfm-file-editor-header .hdwfm-label
        {
            font-weight: bold;
        }
        .hdwfm-file-editor-header .hdwfm-editing-file
        {
            color: white;
            text-decoration: underline;
        }
        .hdwfm-file-editor-content
        {
            font-family: courier;
            border: 1px solid #f1f1f1;
            background-color: #F1F1F1;
            height: 400px;
            overflow: hidden;
        }
        .hdwfm-file-editor-content .hdwfm-file-editor-content-rownumber
        {
            background-color: #F1F1F1;
            color: #808080;
            display: block;
            float: left;
            font-size: 11px;
            height: 396px;
            padding-top: 1px;
            position: relative;
            text-align: right;
            width: 34px;
            top: 2px;
        }
        .hdwfm-file-editor-content .hdwfm-file-editor-content-editor
        {
            background-color: gray;
            display: block;
            float: left;
            height: 400px;
            width: 664px;
        }
        .hdwfm-file-editor-content .hdwfm-file-editor-textarea
        {
            display: block;
            font-size: 13px;
            height: 393px;
            line-height: 120%;
            margin: auto;
            overflow: auto;
            width: 656px;
        }
        .hdwfm-file-editor-bottom
        {
            height: 20px;
            background-color: Gray;
        }
        .hdwfm-file-editor-buttons a
        {
            height: 18px;
            text-align: center;
            text-decoration: none;
            color: black;
            background-color: lightBlue;
            -moz-border-radius: 3px 3px 3px 3px;
            width: 50px;
            display: block;
            float: left;
        }
        .hdwfm-file-editor-buttons a:hover
        {
            color: Blue;
        }
        .hdwfm-file-editor-btn-save
        {
            margin: 1px 20px 0pt 0pt;
        }
        .hdwfm-file-editor .hdwfm-file-editor-btn-cancel
        {
            margin: 1px 0;
        }
        
        .hdwfm-menu
        {
            background: #FFF;
            border: 1px solid #444;
            display: none;
            width: 150px;
            opacity: 0.9;
        }
        .hdwfm-menu ul, .hdwfm-menu ul *
        {
            padding: 0;
            margin: 0;
        }
        .hdwfm-menu ul li
        {
            list-style: none;
            border: 1px solid #444;
            display: block;
        }
        .hdwfm-menu ul li:hover
        {
            background: #666;
            color: #FFF;
        }
        .hdwfm-menu ul li:hover span
        {
            color: #FFF;
        }
        .hdwfm-menu li:hover a
        {
            color: #FFF;
        }
        .hdwfm-menu a
        {
            color: #000;
            display: block;
            font: 11px Tahoma;
            font-weight: bold;
            text-decoration: none;
            padding: 4px;
        }
        
        .hdwfm-log-container
        {
            background-color: silver;
            display: none;
            margin: 10px auto;
            width: 900px;
        }
        .hdwfm-log-container .hdwfm-log-header
        {
            display: block;
            height: 20px;
        }
        .hdwfm-log-container .hdwfm-log-header .hdwfm-log-header-caption
        {
            display: block;
            float: left;
            font-weight: bold;
        }
        .hdwfm-log-container .hdwfm-log-header .hdwfm-log-header-close
        {
            background-color: lightCoral;
            color: Black;
            display: block;
            float: right;
            text-align: center;
            text-decoration: none;
            width: 20px;
        }
        .hdwfm-log-container .hdwfm-logger
        {
            background-color: black;
            border: medium none;
            color: lime;
            display: block;
            font-family: monospace;
            height: 295px;
            margin-left: 1px;
            overflow: auto;
            width: 898px;
        }
        
        .hdwfm-popup
        {
            background-color: silver;
            display: none;
            left: 0;
            margin: 0 auto;
            right: 0;
            top: 190px;
            width: 235px;
        }
        .hdwfm-popup .hdwfm-popup-header
        {
            background-color: Gray;
            display: block;
            height: 17px;
        }
        .hdwfm-file-uploader .hdwfm-file-uploader-header span
        {
            font-size: 12px;
            display: block;
            float: left;
        }
        .hdwfm-file-uploader .hdwfm-file-uploader-header .hdwfm-fu-header-upload-path
        {
            color: white;
            font-size: 12px;
            font-weight: bold;
            height: 18px;
            overflow: hidden;
            width: 160px;
        }
        .hdwfm-popup .hdwfm-popup-content
        {
            padding: 5px;
            height: 30px;
        }
        .hdwfm-file-uploader .hdwfm-file-uploader-content span
        {
            font-size: 10px;
        }
        .hdwfm-popup .hdwfm-popup-footer
        {
            background-color: gray;
            display: block;
            height: 24px;
        }
        .hdwfm-popup .hdwfm-popup-footer a
        {
            display: block;
        }
        .hdwfm-file-uploader .hdwfm-file-uploader-footer .hdwfm-file-upload-file
        {
            float: left;
            margin-left: 10px;
        }
        .hdwfm-file-uploader .hdwfm-file-uploader-footer .hdwfm-file-hide-upload-panel
        {
            float: right;
            margin-right: 10px;
        }
        
        .hdwfm-new-item .hdwfm-new-item-content input
        {
            width: 190px;
        }
        
        .hdwfm-renamer-popup
        {
            background-color: silver;
            display: none;
            left: 0;
            margin: 0 auto;
            right: 0;
            top: 190px;
            width: 235px;
        }
        .hdwfm-renamer-popup .hdwfm-renamer-popup-header
        {
            background-color: Gray;
            display: block;
            height: 18px;
        }
        .hdwfm-renamer-popup .hdwfm-renamer-popup-title
        {
            font-size: 14px;
            text-decoration: underline;
        }
        .hdwfm-renamer-popup .hdwfm-renamer-popup-content
        {
            padding: 5px;
        }
        .hdwfm-renamer-popup .hdwfm-renamer-popup-label
        {
            float: left;
            width: 40px;
        }
        .hdwfm-renamer-popup .hdwfm-renamer-popup-rename-from span
        {
            display: block;
        }
        .hdwfm-renamer-popup .hdwfm-renamer-popup-file-name-wrapper
        {
            float: left;
            overflow: hidden;
            width: 183px;
        }
        .hdwfm-renamer-popup .hdwfm-renamer-popup-items
        {
            border-bottom: 1px dashed;
            display: block;
            height: 25px;
            padding: 3px 0;
            width: 225px;
        }
        .hdwfm-renamer-popup .hdwfm-renamer-popup-file-name
        {
            background-color: #EAEAEA;
            width: 185px;
        }
        .hdwfm-renamer-popup .hdwfm-renamer-popup-new-name
        {
            width: 185px;
        }
        .hdwfm-renamer-popup .hdwfm-renamer-popup-footer
        {
            background-color: gray;
            height: 24px;
        }
        .hdwfm-renamer-popup .hdwfm-renamer-popup-footer .hdwfm-renamer-popup-action-rename
        {
            display: block;
            float: left;
            margin-left: 5px;
        }
        .hdwfm-renamer-popup .hdwfm-renamer-popup-footer .hdwfm-renamer-popup-action-close
        {
            display: block;
            float: right;
            margin-right: 4px;
        }
        
        .hdwfm-copy-popup
        {
            background-color: silver;
            display: none;
            left: 0;
            margin: 0 auto;
            right: 0;
            top: 190px;
            width: 235px;
        }
        .hdwfm-copy-popup .hdwfm-copy-popup-header
        {
            background-color: Gray;
            display: block;
            height: 18px;
        }
        .hdwfm-copy-popup .hdwfm-copy-popup-title
        {
            font-size: 14px;
            text-decoration: underline;
        }
        .hdwfm-copy-popup .hdwfm-copy-popup-content
        {
            padding: 5px;
        }
        .hdwfm-copy-popup .hdwfm-copy-popup-label
        {
            float: left;
            width: 40px;
        }
        .hdwfm-copy-popup .hdwfm-copy-popup-copy-from span
        {
            display: block;
        }
        .hdwfm-copy-popup .hdwfm-copy-popup-file-name-wrapper
        {
            float: left;
            overflow: hidden;
            width: 183px;
        }
        .hdwfm-copy-popup .hdwfm-copy-popup-items
        {
            border-bottom: 1px dashed;
            display: block;
            height: 25px;
            padding: 3px 0;
            width: 225px;
        }
        .hdwfm-copy-popup .hdwfm-copy-popup-file-name
        {
            background-color: #EAEAEA;
            width: 185px;
        }
        .hdwfm-copy-popup .hdwfm-copy-popup-new-name
        {
            width: 185px;
        }
        .hdwfm-copy-popup .hdwfm-copy-popup-footer
        {
            background-color: gray;
            height: 24px;
        }
        .hdwfm-copy-popup .hdwfm-copy-popup-footer .hdwfm-copy-popup-action-copy
        {
            display: block;
            float: left;
            margin-left: 5px;
        }
        .hdwfm-copy-popup .hdwfm-copy-popup-footer .hdwfm-copy-popup-action-close
        {
            display: block;
            float: right;
            margin-right: 4px;
        }
        
        .hdwfm-file-explorer-bottom
        {
            display: block;
        }
        .hdwfm-file-explorer-bottom-col
        {
            display: none;
        }
        .hdwfm-bottom-col01
        {
            width: 50%;
            padding-left: 50px;
        }
        .hdwfm-bottom-col01 .hdwfm-file-explorer-bottom-copy
        {
            display: inline-block;
            width: 100px;
            height: 18px;
        }
        .hdwfm-bottom-col01 .hdwfm-file-explorer-bottom-move
        {
            display: inline-block;
            width: 150px;
            height: 18px;
        }
        .hdwfm-bottom-col01 .hdwfm-file-explorer-bottom-delete
        {
            display: inline-block;
            width: 100px;
            height: 18px;
        }
        
        .hdwfm-bottom-col01
        {
            padding-left: 50px;
        }
        .hdwfm-bottom-col02 .hdwfm-file-explorer-bottom-copy
        {
            display: inline-block;
            width: 100px;
            height: 18px;
        }
        .hdwfm-bottom-col02 .hdwfm-file-explorer-bottom-move
        {
            display: inline-block;
            width: 150px;
            height: 18px;
        }
        .hdwfm-bottom-col02 .hdwfm-file-explorer-bottom-delete
        {
            display: inline-block;
            width: 100px;
            height: 18px;
        }
    </style>
</head>
<body>
    <%-- ************ controls ************ --%>
    <div class="hdwfm-file-explorer">
        <div class="hdwfm-file-explorer-header">
            <div class="hdwfm-file-explorer-header-col hdwfm-explorer-header-col01">
                <select class="hdwfm-file-explorer-header-drives">
                    <option value="C" selected="selected">C</option>
                    <option value="D">D</option>
                </select>
                <a class="hdwfm-file-explorer-header-goto-links hdwfm-file-explorer-header-refresh-drives"
                    href="javascript:void(0)" title="refresh drives list">*</a>
                <label for="path_col01">
                    Path:</label>
                <input type="text" value="d:/" id="path_col01" class="hdwfm-text" />
                <a class="hdwfm-file-explorer-header-goto-links hdwfm-file-explorer-header-goto-path"
                    href="javascript:void(0)" title="go to path on left">go</a> <a class="hdwfm-file-explorer-header-goto-links hdwfm-file-explorer-header-goto-parent"
                        href="javascript:void(0)" title="parent">..</a> <a class="hdwfm-file-explorer-header-goto-links hdwfm-file-explorer-header-goto-root"
                            href="javascript:void(0)" title="root">/</a> <a class="hdwfm-file-explorer-header-goto-links hdwfm-file-explorer-header-goto-this-items-folder"
                                href="javascript:void(0)" title="goto this file's folder">#</a>
                <a class="hdwfm-file-explorer-header-goto-links hdwfm-file-explorer-header-upload"
                    href="javascript:void(0)" title="upload to his folder">^</a> <a class="hdwfm-file-explorer-header-goto-links hdwfm-file-explorer-header-new-file"
                        href="javascript:void(0)" title="create new empty file">()</a> <a class="hdwfm-file-explorer-header-goto-links hdwfm-file-explorer-header-new-folder"
                            href="javascript:void(0)" title="create new folder">[]</a>
            </div>
            <div class="hdwfm-file-explorer-header-col hdwfm-explorer-header-col02">
                <select class="hdwfm-file-explorer-header-drives">
                    <option value="C" selected="selected">C</option>
                    <option value="D">D</option>
                </select>
                <a class="hdwfm-file-explorer-header-goto-links hdwfm-file-explorer-header-refresh-drives"
                    href="javascript:void(0)" title="refresh drives list">*</a>
                <label for="path_col01">
                    Path:</label>
                <input type="text" value="d:/" id="path_col02" class="hdwfm-text" />
                <a class="hdwfm-file-explorer-header-goto-links hdwfm-file-explorer-header-goto-path"
                    href="javascript:void(0)" title="go to path on left">go</a> <a class="hdwfm-file-explorer-header-goto-links hdwfm-file-explorer-header-goto-parent"
                        href="javascript:void(0)" title="parent">..</a> <a class="hdwfm-file-explorer-header-goto-links hdwfm-file-explorer-header-goto-root"
                            href="javascript:void(0)" title="root">/</a> <a class="hdwfm-file-explorer-header-goto-links hdwfm-file-explorer-header-goto-this-items-folder"
                                href="javascript:void(0)" title="goto this file's folder">#</a>
                <a class="hdwfm-file-explorer-header-goto-links hdwfm-file-explorer-header-upload"
                    href="javascript:void(0)" title="upload to his folder">^</a> <a class="hdwfm-file-explorer-header-goto-links hdwfm-file-explorer-header-new-file"
                        href="javascript:void(0)" title="create new empty file">()</a> <a class="hdwfm-file-explorer-header-goto-links hdwfm-file-explorer-header-new-folder"
                            href="javascript:void(0)" title="create new folder">[]</a>
            </div>
        </div>
        <div class="hdwfm-file-explorer-content">
            <div class="hdwfm-file-explorer-col hdwfm-explorer-col01">
            </div>
            <div class="hdwfm-file-explorer-col hdwfm-explorer-col02">
                <div class="hdwfm-file-explorer-row">
                    <div class="hdwfm-file-explorer-row-margin hdwfm-margin-left">
                    </div>
                    <div class="hdwfm-file-explorer-row-col hdwfm-row-col01">
                        <input type="checkbox" />
                    </div>
                    <div class="hdwfm-file-explorer-row-col hdwfm-row-col02">
                        <div class="hdwfm-file-explorer-item-type hdwfm-folder" title="folder">
                        </div>
                    </div>
                    <div class="hdwfm-file-explorer-row-col hdwfm-row-col03">
                        <span title="ceva fisier text ...">ceva fisier text ...</span>
                    </div>
                    <div class="hdwfm-file-explorer-row-col hdwfm-row-col04">
                        <span>224.17 MB</span>
                    </div>
                    <div class="hdwfm-file-explorer-row-col hdwfm-row-col05">
                        <div class="hdwfm-file-explorer-created-date">
                            C: 12:00:00 12.12.2010</div>
                        <div class="hdwfm-file-explorer-modified-date">
                            M: 12:00:00 12.12.2010</div>
                    </div>
                    <div class="hdwfm-file-explorer-row-col hdwfm-row-col06">
                        <a class="hdwfm-action-download" title="download" href="javascript:void(0);">D</a>
                        <a class="hdwfm-action-edit" title="edit" href="javascript:void(0);">E</a> <a class="hdwfm-action-copy-to"
                            title="copy to" href="javascript:void(0);">C</a> <a class="hdwfm-action-move-to"
                                title="move to" href="javascript:void(0);">M</a> <a class="hdwfm-action-delete" title="delete"
                                    href="javascript:void(0);">X</a>
                    </div>
                    <div class="hdwfm-file-explorer-row-margin hdwfm-margin-right">
                    </div>
                </div>
            </div>
        </div>
        <div class="hdwfm-file-explorer-bottom">
            <div class="hdwfm-file-explorer-bottom-col hdwfm-bottom-col01">
                <a class="hdwfm-file-explorer-bottom-copy" href="javascript:void(0);">Copy</a> <a
                    class="hdwfm-file-explorer-bottom-move" href="javascript:void(0);">Rename/Move</a>
                <a class="hdwfm-file-explorer-bottom-delete" href="javascript:void(0);">Delete</a>
            </div>
            <div class="hdwfm-file-explorer-bottom-col hdwfm-bottom-col02">
                <a class="hdwfm-file-explorer-bottom-copy" href="javascript:void(0);">Copy</a> <a
                    class="hdwfm-file-explorer-bottom-move" href="javascript:void(0);">Rename/Move</a>
                <a class="hdwfm-file-explorer-bottom-delete" href="javascript:void(0);">Delete</a>
            </div>
            <a href="javascript:void(0);" class="hdwfm-file-explorer-bottom-recycle">recycle</a>
            <a href="javascript:void(0);" class="hdwfm-file-explorer-bottom-show-logs">logs</a>
        </div>
    </div>
    <div class="hdwfm-file-editor">
        <div class="hdwfm-file-editor-header">
            <span class="hdwfm-label">Editing:</span> <span class="hdwfm-editing-file">d:/Kituri/si
                inca ceva/test.txt</span>
        </div>
        <div class="hdwfm-file-editor-content">
            <div class="hdwfm-file-editor-content-rownumber">
            </div>
            <div class="hdwfm-file-editor-content-editor">
                <textarea class="hdwfm-file-editor-textarea" wrap="OFF"></textarea>
            </div>
        </div>
        <div class="hdwfm-file-editor-bottom">
            <div class="hdwfm-file-editor-buttons" style="display: block; float: right; margin-right: 30px;">
                <a href="javascript:void(0)" class="hdwfm-file-editor-btn-save">save</a> <a href="javascript:void(0)"
                    class="hdwfm-file-editor-btn-cancel">cancel</a>
            </div>
        </div>
    </div>
    <div class="hdwfm-menu hdwfm-menu-folder">
        <ul>
            <li><a href="javascript:void(0);" class="hdwfm-menu-action hdwfm-menu-folder-action-copy">
                Copy</a></li>
            <li><a href="javascript:void(0);" class="hdwfm-menu-action hdwfm-menu-folder-action-rename">
                Rename/Move</a></li>
            <li><a href="javascript:void(0);" class="hdwfm-menu-action hdwfm-menu-folder-action-delete">
                Delete</a></li>
            <li><a href="javascript:void(0);" class="hdwfm-menu-action hdwfm-menu-folder-action-download">
                *Download</a></li>
            <li><a href="javascript:void(0);" class="hdwfm-menu-action hdwfm-menu-folder-action-archive">
                *Archive</a></li>
        </ul>
    </div>
    <div class="hdwfm-menu hdwfm-menu-file">
        <ul>
            <li><a href="javascript:void(0);" class="hdwfm-menu-action hdwfm-menu-file-action-edit">
                Edit</a></li>
            <li><a href="javascript:void(0);" class="hdwfm-menu-action hdwfm-menu-file-action-rename">
                Rename/Move</a></li>
            <li><a href="javascript:void(0);" class="hdwfm-menu-action hdwfm-menu-file-action-copy">
                Copy</a></li>
            <li><a href="javascript:void(0);" class="hdwfm-menu-action hdwfm-menu-file-action-delete">
                Delete</a></li>
            <li><a href="javascript:void(0);" class="hdwfm-menu-action hdwfm-menu-file-action-download">
                Download</a></li>
            <li><a href="javascript:void(0);" class="hdwfm-menu-action hdwfm-menu-file-action-run">
                Run</a></li>
            <li><a href="javascript:void(0);" class="hdwfm-menu-action hdwfm-menu-file-action-archive">
                *Archive</a></li>
            <li><a href="javascript:void(0);" class="hdwfm-menu-action hdwfm-menu-file-action-unarchive">
                *UnArchive</a></li>
        </ul>
    </div>
    <div class="hdwfm-log-container">
        <div class="hdwfm-log-header">
            <span class="hdwfm-log-header-caption">Logging window</span> <a href="javascript:void(0);"
                class="hdwfm-log-header-close">X</a>
        </div>
        <div class="hdwfm-log-content">
            <textarea class="hdwfm-logger" readonly="readonly" wrap="OFF"></textarea>
        </div>
    </div>
    <div class="hdwfm-popup hdwfm-file-uploader">
        <div class="hdwfm-popup-header hdwfm-file-uploader-header">
            <span class="hdwfm-fu-header-upload-to">Uploading to:</span><span class="hdwfm-fu-header-upload-path">c:/bla/bla/bla</span>
        </div>
        <div class="hdwfm-popup-content hdwfm-file-uploader-content">
            <input type="file" name="file" id="fileInput" class="hdwfm-file-file-input" title="fileInput"
                runat="server" />
            <span></span>
        </div>
        <div class="hdwfm-popup-footer hdwfm-file-uploader-footer">
            <input type="button" class="hdwfm-file-upload-file" value="Upload" />
            <input type="button" class="hdwfm-file-hide-upload-panel" value="Close" onclick="hidePopupPanel();" />
        </div>
    </div>
    <div class="hdwfm-popup hdwfm-new-item">
        <div class="hdwfm-popup-header hdwfm-new-item-header">
            <span class="hdwfm-ni-header">Create new:</span> <span class="hdwfm-ni-header-path">
            </span>
        </div>
        <div class="hdwfm-popup-content hdwfm-new-item-content">
            <input type="text" name="newItem" />
        </div>
        <div class="hdwfm-popup-footer hdwfm-new-item-footer">
            <input type="button" class="hdwfm-new-item-action" value="Create" />
            <input type="button" class="hdwfm-new-item-cancel" value="Close" onclick="hidePopupPanel();" />
        </div>
    </div>
    <div class="hdwfm-renamer-popup">
        <div class="hdwfm-renamer-popup-header">
            <span class="hdwfm-renamer-popup-title">Rename/Move:</span>
        </div>
        <div class="hdwfm-renamer-popup-content">
            <div class="hdwfm-renamer-popup-items hdwfm-renamer-popup-rename-from">
                <span class="hdwfm-renamer-popup-label">From:</span> <span class="hdwfm-renamer-popup-file-name-wrapper">
                    <input type="text" class="hdwfm-renamer-popup-file-name hdwfm-text" readonly="readonly" />
                </span>
            </div>
            <div class="hdwfm-renamer-popup-items hdwfm-renamer-popup-rename-to">
                <span class="hdwfm-renamer-popup-label">To:</span>
                <input type="text" class="hdwfm-renamer-popup-new-name hdwfm-text" />
            </div>
        </div>
        <div class="hdwfm-renamer-popup-footer">
            <input type="button" class="hdwfm-renamer-popup-action-rename" value="Rename/Move" />
            <input type="button" class="hdwfm-renamer-popup-action-close" value="Close" onclick="hidePopupPanel();" />
        </div>
    </div>
    <div class="hdwfm-copy-popup">
        <div class="hdwfm-copy-popup-header">
            <span class="hdwfm-copy-popup-title">Copy:</span>
        </div>
        <div class="hdwfm-copy-popup-content">
            <div class="hdwfm-copy-popup-items hdwfm-copy-popup-copy-from">
                <span class="hdwfm-copy-popup-label">From:</span> <span class="hdwfm-copy-popup-file-name-wrapper">
                    <input type="text" class="hdwfm-copy-popup-file-name hdwfm-text" readonly="readonly" />
                </span>
            </div>
            <div class="hdwfm-copy-popup-items hdwfm-copy-popup-copy-to">
                <span class="hdwfm-copy-popup-label">To:</span>
                <input type="text" class="hdwfm-copy-popup-new-name hdwfm-text" />
            </div>
        </div>
        <div class="hdwfm-copy-popup-footer">
            <input type="button" class="hdwfm-copy-popup-action-copy" value="Copy" />
            <input type="button" class="hdwfm-copy-popup-action-close" value="Close" onclick="hidePopupPanel();" />
        </div>
    </div>
</body>
</html>
